Hardships

Loss of employment became a major economic shock to many families and individuals who experienced it or are still experiencing it. Since the onset of the COVID-19 pandemic, unemployment in the United States has reached record highs.

In the summer of 2020, the Household Pulse Survey showed that in the United States, 126, 554, 411 people (51.1% of the adult population) had experienced loss of employment income. In Texas they were 11, 384, 721 (53.5%), and in the two metropolitan areas of this state that were considered, Dallas-Forth Worth-Arlington and Houston-The Woodlands-Sugar Land, they were 3, 002, 219 (56.3%) and 3, 687, 668 (59.2%), respectively.

The San Antonio Energy and Time Use Survey is an online survey that was answered between March 22-24 by residents of zip codes 78230 (referred to as Elm Creek) and 78202 (referred to as Jefferson Heights). With the information obtained from this source, we present a snapshot of the employment loss hardships experienced by these San Antonio residents.

Since the onset of COVID-19 (March 2020), 57.4% experienced the loss of employment income. This figure was 60% in Elm Creek and 40% in Jefferson Heights. Figure 1 also shows the percentage of residents by race and ethnicity who experienced job loss.

loss %>% 
  ggplot(aes(x = zipcode, y = pct, fill = race_eth2)) + 
  geom_bar(stat = "identity", position = "dodge", color = "gray30") +
  geom_text(aes(label = lbl), size = 6.5, color = "gray30", position = position_dodge(width = .9), vjust = -.7, family = "foo") +
  scale_y_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_fill_jama() +
  labs(y = NULL, x = NULL, fill = NULL,
       title = "Figure 1. Loss of employment distribution by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeu

loss %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = zipcode)) +
  geom_point(stat = "identity", size = 5) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .5), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1)) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Figure 1. Loss of employment distribution by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .5), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, x = NULL, color = NULL, size = NULL,
       title = "Figure 1. Loss of employment distribution by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

Loss of employment and health

The impacts of the pandemic are particularly prevalent among African American, Latinx, indigenous, and immigrant households. One representation of long-standing inequalities and an orderly system that reinforces the inequality gap between the different groups.

In many cases, job loss also represents loss of main income for the household, specially in households with dependents. In such cases, paying for the necessary food, the utility bills or rent/mortgage, can turn dramatically into more hardships to deal with during this pandemic.

An adequate state of health would be difficult to achieve under these conditions. In Figure 2 we show the self-reported health status among those respondents who lost their jobs.

lossxhealth %>% 
  ggplot(aes(x = zipcode, y = pct, fill = health)) + 
  geom_bar(stat = "identity", position = "dodge", color = "gray30") +
  geom_text(aes(label = lbl), size = 7, color = "gray30", position = position_dodge(width = .9), vjust = -.7, family = "foo") +
  scale_y_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_fill_manual(values = wes_palette(name = "Zissou1", n = 5)) +
  labs(y = NULL, 
       fill = NULL,
       x = NULL, 
       title = str_wrap("Figure 2. Self-rated health status distribution among those who lost their job", width = 60), 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeu

lossxhealth %>% 
  ggplot(aes(color = zipcode, x = pct, y = health)) + 
  geom_point(stat = "identity", size = 5) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .5), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_y_discrete(limits = rev(levels(data$health))) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  labs(y = NULL, x = NULL, color = NULL,
       title = str_wrap("Figure 2. Self-rated health status distribution among those who lost their job", width = 60), 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

lossxhealth %>% 
  ggplot(aes(color = zipcode, x = pct, y = health)) + 
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .5), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_y_discrete(limits = rev(levels(data$health))) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, x = NULL, color = NULL,
       title = str_wrap("Figure 2. Self-rated health status distribution among those who lost their job", width = 60), 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

Loss of employment and health II

We present the average number of days with not good physical health and mental health among those who lost their job.

lossxhealth2 %>% 
  mutate(label = ph.mean) %>% 
  ggplot(aes(x = ph.mean, y = reorder(race_eth2, ph.mean))) + 
  geom_line(color = "gray70", size = 1) +
  geom_point(aes(color = depen, size = n), shape = 19) +
  facet_grid(~zipcode) +
  geom_text_repel(aes(label = label, x = ph.mean), size = 6, color = "gray30", nudge_y = .31, segment.alpha = 0, family = "foo") +
  scale_color_igv(palette = "alternating") +
  scale_x_continuous(limits = c(0, 5), breaks = seq(0, 5, 1)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, 
       color = "Do you have any dependents?",
       x = "Number of days",
       title = str_wrap("For how many days during the past 30 days was your physical health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good physical health by race and ethnicity", width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() + 
  themeuf 

lossxhealth2 %>% 
  mutate(label = mh.mean) %>% 
  ggplot(aes(x = mh.mean, y = reorder(race_eth2, mh.mean))) + 
  geom_line(color = "gray70", size = 1) +
  geom_point(aes(color = depen, size = n), shape = 19) +
  facet_grid(~zipcode) +
  geom_text_repel(aes(label = label, x = mh.mean), size = 6, color = "gray30", nudge_y = .31, segment.alpha = 0, family = "foo") +
  scale_color_igv(palette = "alternating") +
  scale_x_continuous(limits = c(0, 12), breaks = seq(0, 12, 2)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL,  
       x = "Number of days", 
       color = "Do you have any dependents?",
       title = str_wrap("For how many days during the past 30 days was your mental health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good mental health by race and ethnicity", width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

Loss of employment and health III

We present the average number of days with not good physical health and mental health among those who lost their job and experienced two more hardships like difficulty in paying utility bills, in affording the kinds of food you need, in paying next rent or mortgage payment, in paying medical bill/health insurance, add delay getting/Do not get medical care or prescription medication.

lossxbad2 <- data %>% 
  filter(bad == "More than two", hardships_1 == 1) %>% 
  group_by(zipcode, race_eth2, depen) %>%
  summarize(ph.mean = round(mean(physical_health), 1),
            mh.mean = round(mean(mental_health), 1),
            n = n()) 

lossxbad2 %>% 
  mutate(label = ph.mean) %>% 
  ggplot(aes(x = ph.mean, y = reorder(race_eth2, ph.mean))) + 
  geom_line(color = "gray70", size = 1) +
  geom_point(aes(color = depen, size = n), shape = 19) +
  facet_grid(~zipcode) +
  geom_text(aes(label = label, x = ph.mean), size = 6, color = "gray30", nudge_y = .3) +
  scale_color_igv(palette = "alternating") +
  scale_x_continuous(limits = c(0, 7), breaks = seq(0, 7, 1)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, x = "Number of days", 
       color = "Do you have any dependents?",
       title = str_wrap("For how many days during the past 30 days was your physical health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good physical health by race and ethnicity among those with more than two hardships",
                           width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

lossxbad2 %>% 
  mutate(label = mh.mean) %>% 
  ggplot(aes(x = mh.mean, y = reorder(race_eth2, mh.mean))) + 
  geom_line(color = "gray70", size = 1) +
  geom_point(aes(color = depen, size = n), shape = 19) +
  facet_grid(~zipcode) +
  geom_text_repel(aes(label = label, x = mh.mean), size = 6, color = "gray30", nudge_y = .3, segment.alpha = 0) +
  scale_color_igv(palette = "alternating") +
  scale_x_continuous(limits = c(0, 15), breaks = seq(0, 15, 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, x = "Number of days", 
       color = "Do you have any dependents?",
       title = str_wrap("For how many days during the past 30 days was your mental health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good mental health by race and ethnicity among those with more than two hardships",
                           width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

1

loss.1 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Loss of employment distribution by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.2 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying utility bills by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties their paying utility bills"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.3 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in affording the kinds of food you need by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties affording the food you need"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.4 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying next rent or mortgage payment by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties paying rent or mortgage"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.5 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying medical bill/health insurance by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties paying medical bills"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.6 %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_x = .02) +
  scale_x_continuous(limits = c(0, 1), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Delay getting medical care or prescription medication by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced delay getting medical care or prescription medication"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

hardships %>% 
  filter(hardships != "No difficulty") %>% 
  ggplot(aes(x = pct, y = reorder(hardships, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .75), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Type of hardship experienced by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), have you, or has anyone in your household experienced any of the following hardships"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

data %>%
  filter(!is.na(bad)) %>% 
  group_by(zipcode, bad) %>%
  summarize(n = n()) %>% 
  mutate(pct = n/sum(n),
         lbl = scales::percent(pct, accuracy = 0.1)) %>% 
  ggplot(aes(x = pct, y = reorder(bad, pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .7), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Number of hardships by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), have you, or has anyone in your household experienced any type of hardships"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

2

loss.1r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Loss of employment distribution by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.2r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying utility bills by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties their paying utility bills"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.3r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in affording the kinds of food you need by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties affording the food you need"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.4r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying next rent or mortgage payment by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties paying rent or mortgage"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.5r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Difficulty in paying medical bill/health insurance by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced difficulties paying medical bills"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

loss.6r %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, pct), color = hardships)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 6, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .02) +
  scale_x_continuous(limits = c(0, .60), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Delay getting medical care or prescription medication by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced delay getting medical care or prescription medication"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

hardships.r %>% 
  filter(hardships != "No difficulty") %>% 
  ggplot(aes(x = pct, y = reorder(hardships, -pct), color = race_eth2)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 4.5, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .65), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Zissou1", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 4), reverse = F, byrow = T, ncol = 3), 
         size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Type of hardship experienced by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), have you, or has anyone in your household experienced any of the following hardships"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf + theme(legend.position = "bottom")

data %>%
  filter(!is.na(bad)) %>% 
  group_by(zipcode, race_eth2, bad) %>%
  summarize(n = n()) %>% 
  mutate(pct = n/sum(n),
         lbl = scales::percent(pct, accuracy = 0.1)) %>% 
  ggplot(aes(x = pct, y = reorder(race_eth2, -pct), color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 5, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .75), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  facet_grid(~bad) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Number of hardships by zip code", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), have you, or has anyone in your household experienced any type of hardships"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf + theme(axis.text.x = element_text(color = "gray40", size = 18))

3

data %>%
  group_by(zipcode, health) %>%
  summarize(n = n()) %>% 
  mutate(pct = n/sum(n),
         lbl = scales::percent(pct, accuracy = 0.1)) %>% 
  ggplot(aes(x = pct, y = health, color = zipcode)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 5, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .5), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_y_discrete(limits = rev(levels(data$health))) +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Self-rated health status by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

data %>%
  group_by(zipcode, race_eth2, health) %>%
  summarize(n = n()) %>% 
  mutate(pct = n/sum(n),
         lbl = scales::percent(pct, accuracy = 0.1)) %>% 
  ggplot(aes(x = pct, y = race_eth2, color = health)) +
  geom_point(stat = "identity", aes(size = n)) +
  geom_text_repel(aes(label = lbl), size = 4.5, color = "gray30", segment.alpha = 0, family = "foo", nudge_y = .3, nudge_x = .01) +
  scale_x_continuous(limits = c(0, .9), breaks = seq(0, 1, .15), label = scales::percent) +
  scale_y_discrete(limits = rev(levels(data$race_eth2))) +
  scale_color_manual(values = wes_palette("Zissou1", n = 5)) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)), size = F) +
  facet_grid(~zipcode) +
  labs(y = NULL, x = NULL, color = NULL,
       title = "Self-rated health status by race and ethnicity", 
       subtitle = str_wrap("Since the onset of COVID-19 (March 2020), has anyone in this household experienced the loss of employment income"),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() +
  themeuf

data %>% 
  group_by(zipcode) %>%
  summarize(ph.mean = round(mean(physical_health), 1),
            mh.mean = round(mean(mental_health), 1),
            n = n()) %>% 
  mutate(label = ph.mean,
         label2 = mh.mean) %>% 
  ggplot(aes(y = zipcode, color = zipcode, group = zipcode)) + 
  geom_point(aes(x = ph.mean), shape = 19, size = 5, show.legend = T) +
  geom_point(aes(x = mh.mean), shape = 18, size = 5, show.legend = T) +
  geom_text_repel(aes(label = label, x = ph.mean), size = 7, color = "gray30", nudge_y = .1, segment.alpha = 0, family = "foo") +
  geom_text_repel(aes(label = label2, x = mh.mean), size = 7, color = "gray30", nudge_y = .1, segment.alpha = 0, family = "foo") +
  annotate("text", x = 2, y = 1, label = "Physical health", color = "gray40", size = 8, hjust = "right") +
  annotate("text", x = 5, y = 2, label = "Mental health", color = "gray40", size = 8, hjust = "left") +
  annotate("curve", x = 2, xend = 3.05, y = .95, yend = 1, colour = "gray60", 
           arrow=arrow(type = "open", length = unit(3, "mm")), curvature = .25, hjust = "upper") +
  annotate("curve", x = 5, xend = 3.8, y = 2.05, yend = 2, colour = "gray60", 
           arrow=arrow(type = "open", length = unit(3, "mm")), curvature = .25, hjust = "upper") +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  scale_x_continuous(limits = c(1, 6), breaks = seq(0, 6, 1)) +
  scale_y_discrete(limits = rev(levels(data$zipcode))) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5), reverse = T),
         size = FALSE) +
  labs(y = NULL, 
       color = NULL,
       x = "Number of days",
       title = str_wrap("For how many days during the past 30 days was your physical health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good physical health by race and ethnicity", width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() + 
  themeuf

data %>% 
  group_by(zipcode, race_eth2) %>%
  summarize(ph.mean = round(mean(physical_health), 1),
            mh.mean = round(mean(mental_health), 1),
            n = n()) %>% 
  mutate(label = ph.mean) %>% 
  ggplot(aes(x = ph.mean, y = race_eth2)) + 
  geom_point(aes(color = zipcode, size = n), shape = 19) +
  geom_text_repel(aes(label = label, x = ph.mean), size = 6, color = "gray30", nudge_y = .31, segment.alpha = 0, family = "foo") +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  scale_x_continuous(limits = c(0, 5), breaks = seq(0, 5, 1)) +
  scale_y_discrete(limits = rev(levels(data$race_eth2))) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, 
       color = NULL,
       x = "Number of days",
       title = str_wrap("For how many days during the past 30 days was your physical health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good physical health by race and ethnicity", width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() + 
  themeuf

data %>% 
  group_by(zipcode, race_eth2) %>%
  summarize(ph.mean = round(mean(physical_health), 1),
            mh.mean = round(mean(mental_health), 1),
            n = n()) %>% 
  mutate(label = mh.mean) %>% 
  ggplot(aes(x =mh.mean, y = race_eth2)) + 
  geom_point(aes(color = zipcode, size = n), shape = 19) +
  geom_text_repel(aes(label = label, x = mh.mean), size = 6, color = "gray30", nudge_y = .31, segment.alpha = 0, family = "foo") +
  scale_color_manual(values = wes_palette("Darjeeling2", n = 3)) +
  scale_x_continuous(limits = c(0, 7), breaks = seq(0, 5, 1)) +
  scale_y_discrete(limits = rev(levels(data$race_eth2))) +
  guides(color = guide_legend(label.position = "left", label.vjust = 0.5, label.hjust = 1, override.aes = list(size = 5)),
         size = FALSE) +
  labs(y = NULL, 
       color = NULL,
       x = "Number of days",
       title = str_wrap("For how many days during the past 30 days was your mental health not good?", width = 50), 
       subtitle = str_wrap("We show the average number of days without good mental health by race and ethnicity", width = 65),
       caption = "Source: 2021 San Antonio Energy and Time Use Survey") +
  theme_classic() + 
  themeuf